<script type="text/javascript">
    $(document).ready(function() {
        $("#activity_checkAll").click(function() {
            if ($(this).attr("checked") == "checked") {
                $(":checkbox").attr("checked", true);
            } else {
                $(":checkbox").attr("checked", false);
            }
        });

    });
</script> 
<legend>
    <h4>
        <?php
        echo $control->getAjaxLink(array('name' => '功能列表', 'id' => 'showEventList'), array(
            'cooker' => 'BAEvent@showEventList'
        ));
        ?>\
        <?php
        echo $control->getAjaxLink('代金券管理', array(
            'cooker' => 'BAVoucher@showUserVoucherHome'
        ));
        ?>\
        <?php echo '代金券类型'; ?>
    </h4>
</legend>
<fieldset>
    <table class="table table-hover">
        <thead>
            <tr>
                <th><input type="checkbox" name="activity_checkAll" id="activity_checkAll"></th>
                <th>类型名称</th>
                <th>类型别名</th>
                <th>操作</th>
            </tr> 
        </thead>
        <tbody>
            <?php
            $voucherCooker = new BAVoucherCooker();
            foreach ($voucherTypeList as $id => $type) {
                $typeName = $type['name'];
                $typeAlias = $type['alias'];
                ?>
                <tr>
                    <td><label class="checkbox">
                            <input type="checkbox" name="subBox[]" value="<?php echo $id; ?>"> 
                        </label></td>
                    <td> <?php echo $typeName; ?> </td>
                    <td> <?php echo $typeAlias; ?> </td>
                    <td>
                        <div class="row-fluid">
                            <?php
                            echo $control->getAjaxLink('我的卡', array(
                                'cooker' => 'BAVoucher@showUserVoucherList',
                                'voucherTypeId' => $id,
                            ));
                            $applyList = $voucherCooker->getUserVoucherApplyList($id);
                            if ($applyList != NULL) {
                                echo '|';
                                echo $control->getAjaxLink('申请列表', array(
                                    'cooker' => 'BAVoucher@showUserVoucherApplyList',
                                    'voucherTypeId' => $id,
                                ));
                            }
                            ?>
                        </div>                   
                    </td>
                </tr>
            <?php }
            ?>
        </tbody>
    </table>
    <div class="pagination">  
        <ul>  
            <li class="active">
                <a href="javascript:void()">前一页</a>    </li>  
            <li class="active">
                <a href="javascript:void()">1</a>    </li>  
            <li class="active">
                <a href="javascript:void()">后一页</a>    </li>  
        </ul>  
    </div>
    <?php
    $wxControl1 = new BUIEventControl('userInfo');
    echo $wxControl1->getLink('领取消费券', array(
        'cooker' => 'BAVoucherCooker@showUserVoucherApplyList',
        'htmlOptions' => array('class' => 'btn btn-warning'),
        'theme' => 'mb_bootstrap'
    ));
    echo '&nbsp;';
    echo $wxControl1->getAjaxLink('申请积分卡', array(
        'cooker' => 'BAVoucherCooker@showUserMemberPointVoucherApplyList',
        'theme' => 'mb_bootstrap',
        'htmlOptions' => array('class' => 'btn btn-info')
    ));
    echo '&nbsp;';
    echo $wxControl1->getAjaxLink('我的积分卡', array(
        'cooker' => 'BAVoucherCooker@showUserMemberPointVoucherList',
        'theme' => 'mb_bootstrap',
        'htmlOptions' => array('class' => 'btn btn-warning')
    ));
    echo '&nbsp;';
    echo $wxControl1->getAjaxLink('我的消费券', array(
        'cooker' => 'BAVoucherCooker@showUserVoucherList',
        'theme' => 'mb_bootstrap',
        'htmlOptions' => array('class' => 'btn btn-info')
    ));
    echo '&nbsp;';
    ?>

    <?php
    echo $wxControl1->getLink(
            array('name' => '微信会员查看', 'id' => 'wxUserInfo'), array(
        'cooker' => 'BAVoucher@showVoucher',
        'htmlOptions' => array(
            'class' => 'btn', 'target' => '_blank'),
        'theme' => 'mb_bootstrap'
            )
    );
    ?>
    
